{{-- resources\views\home\main.blade.php --}}
<section class="row row-cols-1 row-cols-sm-2 mu-3 mb-3">
    @include('custom.phpFunction')
    @php
        // 设置时区
        date_default_timezone_set(env('USER_TIMEZONE', 'PRC'));
        $classify_kv = array_column(objectToArray($classify), 'cname', 'cid');
    @endphp
    <div hidden>@dump($articles, $classify, $classify_kv)</div>
    @foreach ($articles as $article)
    <div class="card card-hover-image-rise container mu-3 mb-3" style="max-width: 540px;">
        <article class="row no-gutters">
            <div class="col-md-4">
                <a class="stretched-link" href="/article/{{ $article->aid }}">
                    <img class="card-img" style="object-fit: cover;padding: 22px 0px;height: 100%;width: 100%; max-height: 170px;" src="{{ $article->img }}">
                </a>
            </div>
            <div class="col-md-8">
                <div class="card-body">
                    <h5 class="card-title">{{ cut_str($article->title, 12, '…') }}</h5>
                    <h6 class="card-subtitle mb-2 text-muted">
                        @php
                        $cid = $article->cid;
                        if ($article->title2 != null)
                            echo cut_str($article->title2, 16, '…');
                        @endphp

                        {{-- {{ cut_str($article->title2, 16, '…') }} --}}
                    </h6>
                    <p class="card-text">
                        {{ cut_str($article->content, 16, '') }}
                        <a class="stretched-link" href="/article/{{ $article->aid }}">…</a>
                    </p>
                    <p class="card-text"><small class="text-muted">最后修改于：{{ date("Y-m-d H:i",$article->lastdate)."| $cid:$classify_kv[$cid]| aid:$article->aid" }}</small></p>
                </div>
            </div>
        </article>
    </div>

    @endforeach


    {{-- <div class="card container" style="max-width: 540px;">
        <article class="row no-gutters">
            <div class="col-md-4">
                <img class="card-img" src="/img/head/IO0288.jpg" alt="IO0288">
            </div>
            <div class="col-md-8">
                <div class="card-body">
                    <h5 class="card-title">卡片标题</h5>
                    <h6 class="card-subtitle mb-2 text-muted">副标题</h6>
                    <p class="card-text">
                        article.article.article.article.article.article.article.article.article.article.</p>
                    <p class="card-text"><small class="text-muted">article.</small></p>
                </div>
            </div>
        </article>
    </div>

    <div class="card container" style="max-width: 540px;">
        <article class="row no-gutters">
            <div class="col-md-4">
                <img class="card-img" src="/img/head/IO0288.jpg" alt="IO0288">
            </div>
            <div class="col-md-8">
                <div class="card-body">
                    <h5 class="card-title">卡片标题</h5>
                    <h6 class="card-subtitle mb-2 text-muted">副标题</h6>
                    <p class="card-text">
                        article.article.article.article.article.article.article.article.article.article.</p>
                    <p class="card-text"><small class="text-muted">article.</small></p>
                </div>
            </div>
        </article>
    </div> --}}
</section>